package com.xwj.dto;

import org.apache.commons.lang3.StringUtils;

import java.beans.Transient;
import java.io.Serializable;

public class OrderInfoDto implements Serializable {
    private static final long serialVersionUID = 1431341295064234689L;

    private String id;

    private String landlordId;

    private String tenantId;

    private String startTime;

    private String endTime;

    private int status;

    public OrderInfoDto() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLandlordId() {
        return landlordId;
    }

    public void setLandlordId(String landlordId) {
        this.landlordId = landlordId;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Transient
    public void setCreateTimeScope(String createTimeScope) {
        if (StringUtils.isBlank(createTimeScope))
            return;
        String[] str = createTimeScope.split(" - ");
        startTime = str[0];
        endTime = str[1];
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        if (StringUtils.isNotBlank(id))
            builder.append(id);
        if (StringUtils.isNotBlank(landlordId))
            builder.append(landlordId);
        if (StringUtils.isNotBlank(tenantId))
            builder.append(tenantId);
        if (StringUtils.isNotBlank(startTime))
            builder.append(startTime);
        if (StringUtils.isNotBlank(endTime))
            builder.append(endTime);
        builder.append(status);
        return builder.toString();
    }
}
